const Koa = require("koa2")
const router = require("koa-router")();
const cors = require("koa2-cors")
const bodyParser = require("koa-bodyparser")
const jwt = require("koa-jwt")
require('@babel/register');
const config = require("./config")
const route = require("./router")
const app = new Koa();
app.use(bodyParser())
app.use(cors())

router.use(route.routes())
app.use(router.routes())
    .use(router.allowedMethods())
















app.listen(config.port, config.host, () => {
    console.log("连接成功:   " + config.host + ":" + config.port);
})